package com.xinqi.modules.exam.paper.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinqi.common.mybatis.data.repo.SuperMapper;
import com.xinqi.modules.exam.paper.domain.CourseExamPaperConfigEntity;
import com.xinqi.modules.exam.paper.dto.req.CourseExamPaperConfigQueryDTO;
import com.xinqi.modules.exam.paper.dto.rsp.CourseExamPaperConfigResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 课程测评配置数据层
 *
 * @author: linkai
 * @date: 2023/07/02
 */
@Mapper
public interface CourseExamPaperConfigMapper extends SuperMapper<CourseExamPaperConfigEntity> {
    Page<CourseExamPaperConfigResultDTO> findPage(Page<Object> page, @Param("dto") CourseExamPaperConfigQueryDTO query);

    List<CourseExamPaperConfigResultDTO> findList(@Param("dto") CourseExamPaperConfigQueryDTO query);

    @Select("select exam_paper_id from co_course_exam_paper_config where id = #{id}")
    Long findExamIdById(@Param("id") Long id);
}
